package com.kelaite.procurement.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity(name = "t_material_master_client")
public class TMaterialMasterClient extends TBaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "company_id")
	private TCompany tCompany;

	@Column(name = "material_name", length = 50, unique = true, nullable = false)
	private String materialName;

	@Column(name = "material_pic", nullable = true)
	private String materialPic;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "unit")
	@NotFound(action = NotFoundAction.IGNORE)
	private TUnit tUnit;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "material_type_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private TMaterialType tMaterialType;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "material_master_central_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private TMaterialMasterCentral tMaterialMasterCentral;

	@Column(name = "material_erp_id", length = 18, nullable = true)
	private String materialERPId;

	@Column(name = "status", length = 2, nullable = false)
	private int status;// 0：未审核 1：已审核

	public TMaterialMasterClient() {

	}

	public Long getId() {

		return id;
	}

	public void setId(Long id) {

		this.id = id;
	}

	public TCompany gettCompany() {

		return tCompany;
	}

	public void settCompany(TCompany tCompany) {

		this.tCompany = tCompany;
	}

	public String getMaterialName() {

		return materialName;
	}

	public void setMaterialName(String materialName) {

		this.materialName = materialName;
	}

	public String getMaterialPic() {

		return materialPic;
	}

	public void setMaterialPic(String materialPic) {

		this.materialPic = materialPic;
	}

	public TUnit gettUnit() {

		return tUnit;
	}

	public void settUnit(TUnit tUnit) {

		this.tUnit = tUnit;
	}

	public TMaterialType gettMaterialType() {

		return tMaterialType;
	}

	public void settMaterialType(TMaterialType tMaterialType) {

		this.tMaterialType = tMaterialType;
	}

	public TMaterialMasterCentral gettMaterialMasterCentral() {

		return tMaterialMasterCentral;
	}

	public void settMaterialMasterCentral(
			TMaterialMasterCentral tMaterialMasterCentral) {

		this.tMaterialMasterCentral = tMaterialMasterCentral;
	}

	public String getMaterialERPId() {

		return materialERPId;
	}

	public void setMaterialERPId(String materialERPId) {

		this.materialERPId = materialERPId;
	}

	public int getStatus() {

		return status;
	}

	public void setStatus(int status) {

		this.status = status;
	}

}
